package org.android.tools;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class ProductUser implements KvmSerializable {
	public Integer idproductShop;
	public User user;
	public Product product;

	public ProductUser() {
	}

   public ProductUser(User user, Product product) {
      this.user = user;
      this.product = product;
   }
   
   public Object getProperty(int arg0) {
		// TODO Auto-generated method stub
		switch(arg0) {
		case 0:
			return idproductShop;
		case 1:
			return product;
		case 2:
			return user;
		}
		return null;
	}

	public int getPropertyCount() {
		// TODO Auto-generated method stub
		return 3;
	}

	public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
		// TODO Auto-generated method stub
		switch(arg0)
       {
       case 0:
       	arg2.type = PropertyInfo.INTEGER_CLASS;
       	arg2.name = "idproductShop";
       	break;
       case 1:
       	arg2.type = new Product().getClass();
       	arg2.name = "product";
           break;
       case 2:
           arg2.type = new User().getClass();
           arg2.name = "user";
           break;
       default:break;
       }
	}

	public void setProperty(int arg0, Object arg1) {
		// TODO Auto-generated method stub
		switch(arg0)
       {
       case 0:
           idproductShop = Integer.parseInt(arg1.toString());
           break;
       case 1:
           product = (Product) arg1;
           break;
       case 2:
           user = (User)arg1;
           break;
       default:
           break;
       }
	}

}
